<div class="spage-main-box">
    <{include file="admin/shoprelation.html"}>  
</div>

<script>

subRelationForm = function (event,sign){ 
	   var target={};
	   switch (sign){
			case 1:                    //保存不关闭
				$extend(target,{
					onComplete:function(){
						if(window.opener.finderGroup&&window.opener.finderGroup['<{$env.get.finder_id}>'])
						window.opener.finderGroup['<{$env.get.finder_id}>'].refresh();
						window.location.reload();
					}}
				);
			break;
			case 2:                   //保存关闭
				$extend(target,{
					onComplete:function(){
						if(window.opener.finderGroup&&window.opener.finderGroup['<{$env.get.finder_id}>'])
						window.opener.finderGroup['<{$env.get.finder_id}>'].refresh();
						window.close();
					}}
				);
			break;				
	   }
	    var _form=$('shop_relation_edit');
		if(!_form)return;
		var _formActionURL=_form.get('action'); 
		
		_form.store('target',target);
        _form.set('action',_formActionURL+'&but='+sign).fireEvent('submit',new Event(event));
    };
</script>
 
<{capture name='footbar'}>
<{assign var="message" value=$___b2c='确定退出?'|t:'b2c'}>
<{assign var="closelabel" value='关  闭'}>
<table cellspacing="0" cellpadding="0" style="margin:0 auto; width:100%" class="table-action">
      <tbody><tr valign="middle">
        <td>
            <{button label=$___b2c='保存并关闭窗口'|t:'b2c' class="btn-primary" onclick="subRelationForm(event,2)"}>
            <!--<{button label=$___b2c='保存当前'|t:'b2c' class="btn-primary" onclick="subRelationForm(event,1)"}>-->
            <{button label=$___b2c=$closelabel|t:'b2c' class="btn-secondary" onclick="if(confirm('{$message}'))window.close()"}>
        </td>
        </tr>
        </tbody></table>
<{/capture}>
